#pragma once

#include<stdio.h>
#include<stdbool.h>
#include<stdlib.h>

char str[100001];
int arr[100001];
int main()
{
	int T = 0;
	int n = 0, k = 0;
	scanf("%d", &T);
	for (int i = 0; i < T; ++i)
	{
		scanf("%d %d", &n, &k);
		getchar();
		scanf("%s", str);
		int left = 0;
		int right = 0;
		int time = 0;
		int len = 0;
		int m = 0;
		int last = 0;
		while (right < n)
		{
			if (str[right] == '1')
			{
				if (left != right)
				{
					if (time < k - 1)
					{
						++time;
						arr[m++] = right - left;
						left = ++right;
					}
					else
						right++;
				}
			}
			else
				{
					if (time == k - 1)
					{
						last = right + 1;
					}
					right++;
				}
			}
		if (time == k - 1 && last!=left)
			arr[m++] = last - left;
		else if (right != left)
			arr[m++] = right - left;

		
}

